package protocol;

public class Protocol {

	public enum Direction {
		NORTH, EAST, SOUTH, WEST
	}

	public enum Field {
		TARGET, FREE, WALL, BLOCK
	}

	public enum Correction {
		Right, Left
	}

	public static int convertToInt(Direction direction) {
		if (direction == Direction.NORTH) {
			return 0;
		} else if (direction == Direction.EAST) {
			return 1;
		} else if (direction == Direction.SOUTH) {
			return 2;
		} else {
			return 3;
		}
	}

	public static Direction convertToDirection(int direction) {
		if (direction == 0) {
			return Direction.NORTH;
		} else if (direction == 1) {
			return Direction.EAST;
		} else if (direction == 2) {
			return Direction.SOUTH;
		} else {
			return Direction.WEST;
		}
	}
}
